home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
smaltalk
/
st80_pr4.lha
/
st80_pre4
/
MoDE
/
PollingEnvModes-Shan.st
< prev
next >
Wrap
Text File
|
1993-07-24
|
5KB
|
192 lines
ExpandedMode subclass: #PollingEnvMode
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'PollingEnvModes-Shan'!
!PollingEnvMode methodsFor: 'controller access'!
defaultControllerClass
^PollingEnvController1! !
!PollingEnvMode methodsFor: 'layering'!
computeSubLayeringBelow: aSubView withIn: aRect
"My only subView is a polling view. It doesn't have to compute the
layering. Shan April 23,1989"
^self! !
!PollingEnvMode methodsFor: 'initialize-release'!
initialize
"Set the borderwidth to 1."
"Shan April 8, 1989"
super initialize.
self borderWidth: 1.
"Assign a color so that the layering algorithm comptes correctly."
self insideColor: Form white! !
!PollingEnvMode methodsFor: 'enter/leaveEvent-process'!
processEnter: enterEvent
"The only subView I have is a polling View. It doesn't process
enterEvent. "
"Shan March 15, 1989"
| topSubView |
visible ifFalse: [^false].
cursorIn _ true.
self controller processEvent: enterEvent!
processLeave: leaveEvent
"The only subView I have is a polling View. It doesn't process
leaveEvent."
"Shan March 15, 1989"
| topSubView |
cursorIn _ false.
visible ifFalse: [^false].
self controller processEvent: leaveEvent!
topSubModeEnteredFrom: offspring
"The only subView I have is a polling View. It doesn't count as a
subMode. Therefore, I don't really have a subMode. Process as if
subViews is nil."
"Shan Mrach 16, 1989"
^nil!
topSubModeLeft
"The only subView I have is a polling View. It doesn't count as a
subMode. Therefore, I don't really have a subMode. Process as if
subViews is nil."
"Shan Mrach 16, 1989"
^nil! !
!PollingEnvMode methodsFor: 'event handling'!
processEvent: event
(self interestedIn: event)
ifTrue:
[event selector = #cursorMove ifTrue: [self processEnterLeave: event].
^self controller processEvent: event]
ifFalse: [^false]! !
!PollingEnvMode methodsFor: 'displaying'!
displaySubViewsOn: aMedium in: aRect
"I have only one subView which is a polling application. It doesn't
understand the message 'displayIn:'."
"Shan March 17, 1989"
"The View class doesn't know how to display on a medium other than
Display. This causes problems when we try to move image. It will
displayBorder on the screen instead of aMedium. Temp fix is to skip
the display message when aMedium is not Display. Shan June 16,
1989 "
aMedium == Display ifFalse: [^self].
subViews do: [:aSubView | aSubView display]! !
!PollingEnvMode methodsFor: 'drag support'!
prepareForDrag: aSymbol
"Shan July 16, 1989"
savedStates _ SaveState controller: self controller cursorIn: cursorIn.
model isNil
ifTrue: [self controller: OpaqueController1 new]
ifFalse: [self controller: (model dragControllerFor: aSymbol)].!
recoverFromDrag: aSymbol
"Set up the normal controller. Shan July 16, 1989"
self controller: savedStates controller.
cursorIn _ savedStates cursorIn.! !
!PollingEnvMode methodsFor: 'private'!
checkResize: w
"Override to stop the resize constraint mechanism defined in Mode.
Shan March 20, 1990"
^self!
clearCursorIn
"I have no subModes. Shan July 28, 1989"
cursorIn _ false! !
!PollingEnvMode methodsFor: 'subMode access'!
firstModeAt: p suchThat: aBlock cutOff: aCltnOfMode
"Do not search the subviews. Shan April 24, 1990"
(aCltnOfMode includes: self)
ifTrue: [^nil].
visible & (self displayBox containsPoint: p) ifFalse: [^nil].
(aBlock value: self)
ifTrue: ["Shan 25 May 1990"
^self]
ifFalse: [^nil]! !
OpaqueController1 subclass: #PollingEnvController1
instanceVariableNames: ''
classVariableNames: 'PollingEnvController1ERD '
poolDictionaries: ''
category: 'PollingEnvModes-Shan'!
!PollingEnvController1 methodsFor: 'private'!
runPolling
"Shan 16 May 1990"
self eventQueue disable.
mode firstSubView controller startUp.
self eventQueue enable! !
!PollingEnvController1 methodsFor: 'Event Handling'!
enterMode
"This is a special case. The code is directly put here. Shan May 24,
1989"
mode superView firstSubView ~= mode ifFalse: [mode toFront].
mode obscuringRects isEmpty ifTrue: ["Shan 15 May 1990"
self runPolling].
^true!
leftButtonDown
"Shan 16 May 1990"
| spMode |
spMode _ mode.
[mode obscuringRects isEmpty]
whileFalse:
[spMode obscuringRects isEmpty ifFalse: [spMode toFront].
spMode _ spMode superMode].
self runPolling.
^true! !
"-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "!
PollingEnvController1 class
instanceVariableNames: ''!
!PollingEnvController1 class methodsFor: 'access'!
eventResponsesDict
^PollingEnvController1ERD! !
!PollingEnvController1 class methodsFor: 'initialize'!
ERDinit
PollingEnvController1ERD _ super eventResponsesDict deepCopy.
PollingEnvController1ERD at: #enterMode put: #self.
"Use leftButton to bring self to front. Shan 16 May 1990"
PollingEnvController1ERD at: #leftButtonDown put: #self! !